package com.linhh.mall.center.server.service;

import com.linhh.mall.center.api.CategoryInfoService;
import com.linhh.mall.center.common.pojo.CategoryInfo;
import com.linhh.mall.center.server.mappers.CategoryInfoMapper;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;


import java.util.List;

/**
 * 实现类
 * @Author linhh
 * @Date 2022 11 07 22 31
 **/
@Service
public class CategoryInfoServiceImpl implements CategoryInfoService {

    @Autowired
    private CategoryInfoMapper categoryInfoMapper;

    @Override
    public List<CategoryInfo> selectAllCateGory() {
        List<CategoryInfo> categories = categoryInfoMapper.selectAllCateGory();
        return categories;
    }

    @Override
    public List<CategoryInfo> selectCategoryLevel2() {
        List<CategoryInfo> categoryInfos = categoryInfoMapper.selectCategoryLevel2();
        return categoryInfos;
    }

    @Override
    public int updateCategory(CategoryInfo categoryInfo) {
        categoryInfoMapper.updateCategory(categoryInfo);
        return 0;
    }

}
